package com.bosssoft.gateway.service.util;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import java.util.concurrent.Executor;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

@Configuration
public class ThreadPoolUtil {

    @Bean(name = "taskExecutor")
    public ThreadPoolExecutor taskExecutor() {
        ThreadPoolExecutor executor = new ThreadPoolExecutor(8,17,60, TimeUnit.SECONDS,new LinkedBlockingQueue<>());
        return executor;
    }
}
